﻿Namespace AdvanceWarsNet.Data
    Public Class Range

        Public Shared NoneRange As Range = New Range(0, 0)

        Sub New(ByVal MinRange As Integer, ByVal MaxRange As Integer)
            If MinRange > MaxRange Then
                Throw New Exception("min range cannot be smaller then the max range")
            End If
            Me.MinRange = MinRange
            Me.MaxRange = MaxRange
        End Sub

        Property MinRange As Integer

        Property MaxRange As Integer

        ReadOnly Property IsInRange(ByVal x As Integer) As Boolean
            Get
                Return x >= MinRange AndAlso x <= MaxRange
            End Get
        End Property

    End Class
End Namespace